package com.xinqi.modules.sys.dict.client;

import com.xinqi.common.base.constants.ServiceNameConstants;
import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.sys.dict.dto.req.DictDocumentCreateDTO;
import com.xinqi.modules.sys.dict.dto.req.DictDocumentQueryDTO;
import com.xinqi.modules.sys.dict.dto.req.DictDocumentUpdateDTO;
import com.xinqi.modules.sys.dict.dto.rsp.DictDocumentResultDTO;
import com.xinqi.modules.sys.dict.factory.DictDocumentFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 文档分类字典表客户端
 *
 * @author: gzy
 * @date: 2023/05/28
 */
@FeignClient(contextId = "dictDocumentClient", value = ServiceNameConstants.XQ_SYS, fallbackFactory = DictDocumentFallbackFactory.class)
public interface DictDocumentClient {

    /**
     * 文档分类字典表-分页
     */
    @GetMapping("/dict-document/page")
    R<PageInfo<DictDocumentResultDTO>> page(DictDocumentQueryDTO dto);

    /**
     * 文档分类字典表-详情
     */
    @GetMapping("/dict-document/{id}")
    R<DictDocumentResultDTO> findById(@PathVariable("id") Long id);

    /**
     * 新增文档分类字典表
     */
    @PostMapping("/dict-document")
    R<Long> insert(@RequestBody DictDocumentCreateDTO dto);

    /**
     * 修改文档分类字典表
     */
    @PutMapping("/dict-document/{id}")
    public R<Boolean> update(@PathVariable("id") Long id, @RequestBody DictDocumentUpdateDTO dto);

    /**
     * 删除文档分类字典表
     */
    @DeleteMapping("/dict-document/{id}")
    R<Boolean> delete(@PathVariable("id") Long id);

}
